package pl.edu.pk.rz.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import pl.edu.pk.rz.entity.Page;

@Controller
public class ManagePageController extends AbstractController{

	@RequestMapping(value = "/admin/manage-pages", method = RequestMethod.GET)
	public ModelAndView showPagesList() {
		List<Page> pages = pageService.listAll();
		
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("pages", pages);
		return new ModelAndView(VIEW_MANAGE_PAGES, MODEL, model);
	}
}
